import java.util.Scanner;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 晓星航
 * Date: 2023-10-24
 * Time: 10:15
 */
public class NumberGuessGame {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("请输入除以3的余数：");
        int remainder3 = scanner.nextInt();

        System.out.println("请输入除以4的余数：");
        int remainder4 = scanner.nextInt();

        System.out.println("请输入除以7的余数：");
        int remainder7 = scanner.nextInt();

        int x = findNumber(remainder3, remainder4, remainder7);
        System.out.println("计算机猜测的数字是：" + x);
    }

    public static int findNumber(int remainder3, int remainder4, int remainder7) {
        for (int i = 1; i <= 100; i++) {
            if (i % 3 == remainder3 && i % 4 == remainder4 && i % 7 == remainder7) {
                return i;
            }
        }
        return -1; // 如果找不到符合条件的数字，则返回-1表示失败
    }
}
